namespace CSharpPro._1027;

public class Demo
{
    private int id;//feild 字段
    private string name;
    private int age;

    public int Id
    {
        get => id;
        set => id = value;
    }

    public string Name
    {
        get => name;
        set => name = value ?? throw new ArgumentNullException(nameof(value));
    }

    public int Age
    {
        get => age;
        set => age = value;
    }
    public void TestPrint()
    {
        
        Parent parent = new Parent();
        parent.Print();
        Child child = new Child();
        child.Print();
        child.Play();
        Console.WriteLine("-----------");
        Parent p1 = new Child();
        p1.Print();
        
        
        
       int resul = Add(10, 20);//实参
       Console.WriteLine(resul);
      int i = Convert.ToInt32("123");
    }
    //overload 重载
    public int Add(int a, int b)
    {
        return a + b;
    }

    public int Add(int a, int b, int c)
    {
        return a + b + c;
    }

    public string Add(string a, string b)
    {
        return a + b;
    }
    
}